<jsp:include page="/vista/ittsa/busbannersup.jsp"></jsp:include>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="WEB-INF/struts-html" 		prefix="html"%>
<%@ taglib uri="WEB-INF/struts-logic" 		prefix="logic"%>
<%@ taglib uri="WEB-INF/struts-bean" 		prefix="bean"%>
<%@ taglib uri="WEB-INF/struts-nested.tld" 	prefix="nested"%>
<%@ taglib uri="WEB-INF/displaytag" 		prefix="display"%>
<%@ page import="java.util.*"%>
<%@ page import="java.lang.*"%>
<%@page import="pe.com.certicom.ittsa.model.bean.*"%>  
<%@page import="pe.com.certicom.ittsa.control.action.*"%>
<%@page import="pe.com.certicom.ittsa.control.form.*"%>

<head>
<link href="vista/css/ui-lightness/jquery-ui-1.8.18.custom.css" type="text/css" rel="stylesheet"></link>
<script type="text/javascript" src="vista/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="vista/js/jquery-ui-1.8.18.custom.min.js"></script>

<script language="javascript" type="text/javascript">
$(function() {
	$("#datepicker").datepicker();
	$('#datepicker').datepicker('option', {dateFormat: 'yy-mm-dd'});
});	
function validarSolicitud(){
if(document.getElementsByName("departamento.idDepartamento")[0].value=='0'){
alert("Seleccionar un Origen");
return false;
}if(document.getElementsByName("departamento.departamento")[0].value=="0"){
alert("Seleccionar un Destino");
return false;
}if(document.getElementById("datepicker").value==""){
alert("Seleccionar una Fecha");
return false;
}else{
	document.getElementsByName("departamento.fecha")[0].value=document.getElementById("datepicker").value;	
	document.getElementsByName("method")[0].value="13";
	document.forms[0].submit();			
return true;
}	 	
}	

function buscarDestino(){
document.getElementsByName("departamento.fecha")[0].value=document.getElementById("datepicker").value;	
document.getElementsByName("method")[0].value="12";
document.forms[0].submit();		
return true;	 	
}

function irMenuInicio(){
	document.getElementsByName("method")[0].value="10";
	document.forms[0].submit();		
	return true;	 	
}
window.onload=alCargar;
function alCargar() {
	<%
		
	if (request.getAttribute("alerta")!=null){%>
	alert("<%=(String)request.getAttribute("alerta")%>");
	<%}
	if(request.getAttribute("fecha")!=null){%>
	document.getElementById("datepicker").value="<%=(String)request.getAttribute("fecha")%>";
	
	<%}%>

	return true;	
	}	
	
	

</script>
</head>
<div id="content"> 
<br/>
<html:form action="/DispAsiento.do" method="post" >
<input type="hidden" name="method"/>
<html:hidden property="departamento.fecha" /> 
	<table width="620px" border="0" cellpadding="0" cellspacing="0" align="center">
		<h1>Disponibilidad de Asientos</h1>
		<br>
		<tr>
			<td width="100%">

				<table class="muestra">  
					<tr>
						<td >
						<div id="seleccion">
						<img src="<%=request.getContextPath()%>/vista/images/sis/origen.png"/>
						</div>
						<div class="styled-select">
						<html:select property="departamento.idDepartamento" onchange="return buscarDestino();" styleClass="">
						<html:option value="0">[--Seleccione--]</html:option>
						<html:optionsCollection property="mapOrigen.listaOrigen" label="departamento" value="idDepartamento"/>
						</html:select>
						</div>
						</td>

						<td>
						<div id="seleccion">
						<img src="<%=request.getContextPath()%>/vista/images/sis/destino.png"/>
						</div>
						<div class="styled-select">
						<html:select property="departamento.departamento"  styleClass="">
						<html:option value="0">[--Seleccione--]</html:option>
						<html:optionsCollection property="mapDestino.listaDestino" label="departamento" value="departamento"/>
						</html:select>
						</div>
						</td>

						<td>
						<div id="seleccion">
						<img src="<%=request.getContextPath()%>/vista/images/sis/calendario.png"/>
						</div>
						<input id="datepicker" class="hasDatepiker" type="text" readonly>
						</td>

					</tr>
		</table>
<br>
		<div align="center">
				<button onclick="return irMenuInicio()" class="btnRegresar"></button> 
				<button onclick="return validarSolicitud();" class="btnBuscar"></button> 
		</div>
	</td>
</tr>
</table> 
<br>
</br>

</html:form>

</div>


				

 